from widgets import widgetMethod

@widgetMethod
def Twitter(handler, params):
    if len(params) < 1:
        raise Exception('Twitter username not set. use /widget/Twitter/username')
    count = 5
    if len(params) > 1:
        count = int(params[1])
        
    handler.templatedic['twitteruser'] = params[0]
    handler.templatedic['count'] = count
        
    return
                    

